class FeederGenerator < Rails::Generator::Base
  def manifest
    record do |m|
      
      # Controller, helper, views, and test directories.
      m.directory 'app/models/'
      m.directory 'app/controllers/'
      m.directory 'app/helpers/'
      m.directory 'app/views/'
      m.directory 'test/functional/'
      m.directory 'test/unit/'

      m.file 'feed.rb','app/models/feed.rb'
                            
      m.file 'entry.rb','app/models/entry.rb'
                  


      m.file 'urls.rb', 'app/models/url.rb'


      m.file 'feeds_controller.rb','app/controllers/feed_controller.rb' 

     #  m.template 'functional_test.rb',
    #              File.join('test/functional',
    #                        controller_class_path,
     #                       "#{controller_file_name}_controller_test.rb")

    #  m.template 'helper.rb',
   #               File.join('app/helpers',
   #                         controller_class_path,
    #                        "#{controller_file_name}_helper.rb")
 
     # m.template 'unit_test.rb',
   #               File.join('test/unit',
    #                        class_path,
   #                         "#{file_name}_test.rb")

   #  m.template 'fixtures.yml',
    #              File.join('test/fixtures',
   #                         "#{table_name}.yml")

      # Controller templates
    m.directory "app/views/feed"
      
    %w( index show_entries new _feed _form ).each do |action|
        m.file "#{action}.rhtml","app/views/feed/#{action}.rhtml"
    end

        m.migration_template 'create_feeds.rb', 'db/migrate'
    end
  end
  
  def file_name
    "create_feeds"
  end


  protected
    # Override with your own usage banner.
    def banner
      "Usage: #{$0} feeder "
    end
end
